﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using MododorWebAPI.Models;

namespace MododorWebAPI.EntityConfigs
{
    public class CompanyEntityConfig : IEntityTypeConfiguration<CompanyModel>
    {
        public void Configure(EntityTypeBuilder<CompanyModel> builder)
        {
            builder.ToTable("Company");
            builder.Property(x=>x.CompanyEnable).HasDefaultValue(true);
            builder.HasMany<ClientModel>(x => x.Clients).WithOne(x => x.Client_idCompany);
        }
    }
}
